Skip to content

Fix thrashing detection and update readme to be correct - #102

Open
oscardssmith wants to merge 4 commits into
mainfrom
os/fix-reliability
Open

Fix thrashing detection and update readme to be correct#102
oscardssmith wants to merge 4 commits into
mainfrom
os/fix-reliability

Conversation

@oscardssmith

Copy link
Copy Markdown
Collaborator

The thrashing detection here was very over-eager (it checked for 3 triggers in 10 seconds but when triggers happen they are likely to happen multiple times in short succession, so we now have a small timeout before logging subsequent thrashing).

This also fixes the previous behavior where if thrashing was detected it would exit noncleanly. Now it logs and moves on.

Lastly updated the readme to include all the options.

@oscardssmith
oscardssmith requested review from gbaraldi and qinsoon July 17, 2026 21:25

@qinsoon qinsoon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@oscardssmith

Copy link
Copy Markdown
Collaborator Author

@gbaraldi any idea what's up with the CI here?

@oscardssmith

Copy link
Copy Markdown
Collaborator Author

@gbaraldi or @topolarity any idea why CI is broken here?

The "max heap" column came from `gc_num().max_memory`, which counts only what
the GC charged itself and so misses everything else the process actually paid
for: the mapped sysimage, code, stacks, malloc'd memory, and any heap a GC
mapped without charging. On the bigint/pollard benchmark the two differ by more
than 3x (202 MB accounted vs 643 MB resident).

Record `Sys.maxrss()` in the child instead (getrusage `ru_maxrss`, peak
resident set size), which counts only pages the OS actually backed with
physical memory -- so an allocator that reserves address space it never touches
is not penalised. Reported as "max rss" in the table, the JSON, and
results.csv.

Also size the repeated results.csv columns by the number of runs that produced
results rather than by the requested run count: a run whose child dies is
skipped, and the mismatched column length would then throw instead of reporting
the runs that did succeed.
At 50M points a single run takes roughly 20 minutes, which dominates the whole
`slow` class -- the other benchmark in it, bigint/pidigits, takes 30 seconds.

Default to 10M and read `GCBENCH_RB_TREE_N` for the original scale. What this
benchmark exists to measure is mark performance on a pointer graph whose
minimum linear arrangement is expensive, i.e. mark doing random access with no
prefetching; at 10M points the live set is still over a gigabyte of Point plus
red-black-tree nodes, far beyond any cache or TLB, so that behaviour is intact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants